import { component$ } from "@builder.io/qwik";
import AdminLayout from "~/components/AdminLayout";
import DashboardStats from "~/components/DashboardStats";
import SubscriptionList from "~/components/SubscriptionList";
import type { DashboardStats as Stats, Subscription } from '~/types';

// Mock data - replace with actual API calls
const mockStats: Stats = {
  totalUrls: 12,
  totalResources: 156,
  activeSubscriptions: 10,
  categoryCounts: {
    news: 4,
    blog: 3,
    'social-media': 2,
    documentation: 3
  }
};

const mockSubscriptions: Subscription[] = [
  {
    id: '1',
    url: 'https://example.com/blog',
    category: 'Blog',
    pattern: '.*\.md$',
    schedule: 'Daily',
    lastChecked: '2024-03-10T10:00:00Z',
    resourceCount: 15,
    status: 'active'
  },
  {
    id: '2',
    url: 'https://news.example.com',
    category: 'News',
    pattern: '.*\.html$',
    schedule: 'Every hour',
    lastChecked: '2024-03-10T11:00:00Z',
    resourceCount: 42,
    status: 'active'
  }
];


export default component$(() => {
	return (
		<AdminLayout>
			<div class="space-y-6">
				<div>
					<h1 class="text-2xl font-semibold text-gray-900">Dashboard</h1>
</div>
<DashboardStats stats={mockStats} />
<div class="mt-8">
<h2 class="text-lg font-medium text-gray-900 mb-4">Recent Subscriptions</h2>
<SubscriptionList subscriptions={mockSubscriptions} />
</div>
</div>
		</AdminLayout>
	)
});
